home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual Basic new SourceCode and Projects / Easy HTML editor / frmsave.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-04-21  |  2.8 KB  |  93 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form Form2 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Save your work == $mTp eazy HTML"
  6.    ClientHeight    =   1860
  7.    ClientLeft      =   4050
  8.    ClientTop       =   3555
  9.    ClientWidth     =   4890
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1860
  14.    ScaleWidth      =   4890
  15.    ShowInTaskbar   =   0   'False
  16.    Begin MSComDlg.CommonDialog cd2 
  17.       Left            =   240
  18.       Top             =   1320
  19.       _ExtentX        =   847
  20.       _ExtentY        =   847
  21.       _Version        =   393216
  22.    End
  23.    Begin VB.CommandButton Command1 
  24.       Caption         =   "Select an option the click this button to save"
  25.       Height          =   495
  26.       Left            =   2640
  27.       TabIndex        =   2
  28.       Top             =   1320
  29.       Width           =   2175
  30.    End
  31.    Begin VB.OptionButton Option2 
  32.       Caption         =   "Save normally by selecting a file and folder"
  33.       Height          =   375
  34.       Left            =   120
  35.       TabIndex        =   1
  36.       Top             =   600
  37.       Width           =   4695
  38.    End
  39.    Begin VB.OptionButton Option1 
  40.       Caption         =   "Create a new directory and save to it"
  41.       Height          =   375
  42.       Left            =   120
  43.       TabIndex        =   0
  44.       Top             =   240
  45.       Width           =   4695
  46.    End
  47. Attribute VB_Name = "Form2"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = False
  50. Attribute VB_PredeclaredId = True
  51. Attribute VB_Exposed = False
  52. Private Sub Command1_Click()
  53. Dim directory$, directory2$
  54. If Option1.Value = True Then
  55. directory$ = InputBox$("Enter the full path of the directory to save your web pages", "$mTp eazy HTML")
  56. On Error GoTo ErrHand
  57. MkDir (directory$)
  58. prompt$ = "Please now enter the name of the new HTML or HTM file" & vbCrLf & "DON'T FORGET TO PUT THE .htm or .html EXTENSION!!"
  59. directory2$ = InputBox(prompt$, "$mTp eazy HTML")
  60. Dim ff
  61. ff = FreeFile
  62. Open directory$ & "\" & directory2$ For Output As #ff
  63. Print #ff, Form1.Text1.Text
  64. Close #ff
  65. DoEvents
  66. MsgBox "Your file has been saved!", , "$mTp eazy HTML"
  67. Unload Form2
  68. Form1.Show
  69. Exit Sub
  70. ErrHand:
  71. Call ErrHandler
  72. End If
  73. If Option2.Value = True Then
  74. CancelError = False
  75. Dim strfilter As String
  76. Dim fff As Integer
  77. fff = FreeFile
  78. strfilter = "HTML files (*.html)|*.html|HTM files (*.htm)|*.htm"
  79. cd2.Filter = strfilter
  80. cd2.InitDir = App.Path
  81. cd2.DialogTitle = "Save your Web Page"
  82. cd2.ShowSave
  83. If cd2.FileName <> "" Then
  84. Open cd2.FileName For Output As #fff
  85. Print #fff, Form1.Text1.Text
  86. Close #fff
  87. End If
  88. End If
  89. End Sub
  90. Private Sub Form_Load()
  91. Me.Icon = Form1.Icon
  92. End Sub
  93.